/**
 * Created by xiaoze on 2017/12/5.
 */
// 新增用户sql语句
var sqlMap = {
  // 用户
  user: {
    add: 'insert into user(id, name, age) values (0, ?, ?)'
  }
}


// 用户注册sql
var registerSqlMap = {
  register: {
    add: 'insert into register(id, username, password, cTime, nickname) values (0, ?, ?, ?, ?)'
  }
}

// 用户注册sql
var selectAllUserSqlMap = {
  userSelectAll: {
    select: function () {
      return 'select * from register';
    }
  }
}

var getTableAllCountSqlMap = {
  getTableAllCount: {
    getCount: function (table) {
      return 'select count(id) from ' + table;
    }
  }
}

// 用户登录获取信息
var getLoginInfo = {
  loginInfo: {
    select: 'select * from register where username = ?'
  }
}

module.exports = {
  userAdd: sqlMap,
  reg: registerSqlMap,
  userSelectAll: selectAllUserSqlMap,
  loginInfo: getLoginInfo
}
